<!--Copyright (c) 2012 Universidad Del Atlántico

Autor 
Autor
Carlos Fuentes

<!--All rights reserved.

<!--Redistribution and use in source and binary forms, with or without
<!--modification, are permitted provided that the following conditions
<!--are met:
<!--1. Redistributions of source code must retain the above copyright
<!--   notice, this list of conditions and the following disclaimer.
<!--2. Redistributions in binary form must reproduce the above copyright
<!--   notice, this list of conditions and the following disclaimer in the
<!--   documentation and/or other materials provided with the distribution.
<!--3. Neither the name of copyright holders nor the names of its
<!--   contributors may be used to endorse or promote products derived
<!--   from this software without specific prior written permission.

<!--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<!--``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
<!--TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
<!--PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
<!--BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
<!--CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
<!--SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
<!--INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
<!--CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
<!--ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
<!--POSSIBILITY OF SUCH DAMAGE.


-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <!--<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>-->
        <script src="js/jquery.js"></script>
        <script src="js/ckeditor/ckeditor.js"></script>
        <script type="text/javascript" src="js/ckeditor/adapters/jquery.js"></script>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript">
            $(function(){
                
            })
            $(document).ready(function(){
            $.get("newEmptyPHP.php",{prueba:"true",ajax:'true'},function(j){
                    var options="";
                    obj=$.parseJSON(j);
                    for(var i=0;i<obj.length;i++){
                        options += '<option value="' + obj[i].optionValue + '">' + obj[i].optionDisplay + '</option>';
                    }
                    $("#preubaselect").html(options);
                })
                $("#preubaselect").on("change",function(){
                    $.ajax({
                        type: "POST",
                        url: "newEmptyPHP.php",
                        data: { preubaselect :$("#preubaselect").val()}
                    }).done(function( msg ) {
                        //alert( "Data Saved: " + msg );
                        $("#cke_editor1").remove();
                        $("#editor1").remove();
                        var input = $("<textarea>").attr("id", "editor1").attr("name","editor1").attr("cols","80").attr("rows","80");
                        $("#prueba").append($(input));
                        $("#editor1").val(msg);
                        
                        $("#editor1").ckeditor(function() { /* callback code */ }, { 
                            toolbar: 'Basic'//,
                            //uiColor: '#'+Math.floor(Math.random()*16777215).toString(16) });
                    });
                    
                })
                   
            });
        </script>
    </head>
    <body>
        <form id="prueba" action="prueback.php" method="POST">
            <select name="preubaselect" id="preubaselect">
                <option value=1>main</option>
                <option value=2>login</option>
                <option value=4>logout</option>
                <option value=5>login2</option>
                <option value=6>login3</option>


            </select>
            <input type="submit">
        </form>

    </body>
</html>
